<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/10
 * Time: 17:26
 */

namespace App\Services;

use App\Traits\ModelTraits;

class BaseService {
    use ModelTraits;

    public function __construct()
    {
        $this->model();
    }

    /**
     * @desc 自定义返回分页结果
     * @param $obj
     * @param $conf
     * @return array
     */
    public static function get_paginate($obj)
    {
        return array(
            'current_page' => $obj->currentPage(),
            'total_page'   => $obj->lastPage(),
            'total'        => $obj->total(),
            'data'         => $obj->items(),
        );
    }
}